//
//  startSucessViewController.m
//  ioschishan
//
//  Created by 千翼网络科技 on 2017/7/17.
//  Copyright © 2017年 qianyi. All rights reserved.
//

#import "startSucessViewController.h"
#import "HomeCrowdfundingViewController.h"

@interface startSucessViewController ()

@end

@implementation startSucessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self leftNavHide];
    [self initView];
}

#pragma mark ------------------ init -------------------

- (void)initView{
    
    self.title = @"项目创建成功";
    
    UIButton *backBtn = [ConfigXp buttonWithFrame:CGRectMake(0, 0, screenScale(20), screenScale(20))
                                             title:nil
                                        titleColor:nil
                                              font:nil
                                   backgroundColor:nil
                                             image:[UIImage imageNamed:@"back_icon"]];
    [backBtn addTarget:self action:@selector(backBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem *rightBarBtnItem = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = rightBarBtnItem;
    
    UIImageView *img = [[UIImageView alloc]init];
    img.image = [UIImage imageNamed:@"successful_icon"];
    [self.view addSubview:img];
    [img mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(screenScale(60));
        make.left.equalTo(self.view).with.offset(screenScale(168));
        make.width.offset(screenScale(40));
        make.height.offset(screenScale(40));
    }];
    
    UILabel *titleLabel = [ConfigXp labelWithFrame:CGRectZero
                                              text:@"您的项目已创建成功"
                                         textColor:getColor(@"5eca34")
                                              font:get4sFont(16)
                                     textAlignment:NSTextAlignmentCenter
                                   backgroundColor:[UIColor clearColor]];
    [self.view addSubview:titleLabel];
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(screenScale(120));
        make.left.equalTo(self.view).with.offset(0);
        make.right.equalTo(self.view).with.offset(0);
        
    }];
    
    UIButton *watchBtn = [ConfigXp buttonWithFrame:CGRectZero
                                             title:@"查看项目"
                                        titleColor:getColor(@"5eca34")
                                              font:get4sFont(14)
                                   backgroundColor:nil
                                             image:nil];
    watchBtn.layer.borderColor = getColor(@"5eca34").CGColor;
    watchBtn.layer.borderWidth = screenScale(1);
    watchBtn.layer.cornerRadius = screenScale(3);
    [watchBtn addTarget:self action:@selector(watchBtnClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:watchBtn];
    [watchBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view).with.offset(screenScale(185));
        make.left.equalTo(self.view).with.offset(screenScale(30));
        make.right.equalTo(self.view).with.offset(screenScale(-30));
        make.height.offset(screenScale(44));
    }];
    
}

#pragma mark ------------------ clcik -------------------

- (void)watchBtnClick{
    
    [self.navigationController popToRootViewControllerAnimated:YES];

//    HomeCrowdfundingViewController *vc = [[HomeCrowdfundingViewController alloc] init];
//    vc.hidesBottomBarWhenPushed = YES;
//    [self.navigationController pushViewController:vc animated:YES];
    
}

- (void)backBtnClick{

    [self.navigationController popToRootViewControllerAnimated:YES];
    
}

@end
